import axios from './request'

/* api 封装 */

//返回菜单栏
export const getMenu = (param) => {
  return axios.request({
    url: '/permission/getMenu',
    method: 'post',
    data: param,
  })
}

// 获取用户列表
export const getUser = (params) => {
  return axios.request({
    url: '/user/getUser',
    method: 'get',
    params,
  })
}

// 添加用户
export const addUser = (data) => {
  return axios.request({
    url: '/user/addUser',
    method: 'post',
    data,
  })
}

//修改用户
export const editUser = (data) => {
  return axios.request({
    url: 'user/editUser',
    method: 'post',
    data,
  })
}
//删除用户
export const deleteUser = (data) => {
  return axios.request({
    url: 'user/deleteUser',
    method: 'post',
    data,
  })
}

// 添加商品
export const addGood = (data) => {
  return axios.request({
    url: 'good/addGood',
    method: 'post',
    data,
  })
}
//修改商品
export const editGood = (data) => {
  return axios.request({
    url: 'good/editGood',
    method: 'post',
    data,
  })
}

// 删除商品
export const deleteGood = (data) => {
  return axios.request({
    url: 'good/deleteGood',
    method: 'post',
    data,
  })
}
